<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arduino A2DP: src/BluetoothA2DPSource.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Arduino A2DP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">BluetoothA2DPSource.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// C++ Class Implementation for a A2DP Source to be used as Arduino Library</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// The original ESP32 implementation can be found at https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/classic_bt/a2dp_source</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//     http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">// limitations under the License.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// Copyright 2020 Phil Schatzmann</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifndef __A2DP_SOURCE_H__</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#define __A2DP_SOURCE_H__</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//#include &quot;Arduino.h&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &quot;freertos/timers.h&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;freertos/xtensa_api.h&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;freertos/FreeRTOSConfig.h&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;freertos/queue.h&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;freertos/task.h&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;nvs.h&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;nvs_flash.h&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;esp_system.h&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;esp_bt.h&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;esp_bt_main.h&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;esp_bt_device.h&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;esp_gap_bt_api.h&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;esp_a2dp_api.h&quot;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;esp_avrc_api.h&quot;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span> </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &quot;BluetoothA2DPCommon.h&quot;</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &quot;esp32-hal-log.h&quot;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &quot;esp32-hal-bt.h&quot;</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#include &quot;SoundData.h&quot;</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">typedef</span> void (* bt_app_cb_t) (uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">typedef</span>  int32_t (* music_data_cb_t) (uint8_t *data, int32_t len);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">typedef</span>  int32_t (* music_data_channels_cb_t) (Channels *data, int32_t len);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="keyword">typedef</span> void (* bt_app_copy_cb_t) (<a class="code" href="structapp__msg__t.html">app_msg_t</a> *msg, <span class="keywordtype">void</span> *p_dest, <span class="keywordtype">void</span> *p_src);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_source.html">   64</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_a2_d_p_source.html">BluetoothA2DPSource</a> {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <span class="keyword">public</span>: </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="class_bluetooth_a2_d_p_source.html#a545a8b10ab474d787744f85fe784d49a">BluetoothA2DPSource</a>();</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#aa95c962faf036331a4cc6cff3e296bd8">start</a>(<span class="keywordtype">char</span>* name, music_data_channels_cb_t callback = NULL, <span class="keywordtype">bool</span> is_ssp_enabled = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#aa95c962faf036331a4cc6cff3e296bd8">start</a>(std::vector&lt;char*&gt; names, music_data_channels_cb_t callback = NULL, <span class="keywordtype">bool</span> is_ssp_enabled = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#a1c6030ee1e7e41282156fd0013a956f5">startRaw</a>(<span class="keywordtype">char</span>* name, music_data_cb_t callback = NULL, <span class="keywordtype">bool</span> is_ssp_enabled = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#a1c6030ee1e7e41282156fd0013a956f5">startRaw</a>(std::vector&lt;char*&gt; names, music_data_cb_t callback = NULL, <span class="keywordtype">bool</span> is_ssp_enabled = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keyword">virtual</span>  <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#afb97a3f9a71350523c44774deebecc8c">setPinCode</a>(<span class="keywordtype">char</span>* pin_code, esp_bt_pin_type_t pin_type=ESP_BT_PIN_TYPE_VARIABLE);</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#aed4eade950c1c8e1fe22eba79cc5df43">writeData</a>(<a class="code" href="class_sound_data.html">SoundData</a> *data);</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keyword">virtual</span>  <span class="keywordtype">bool</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#a4e98bae7828ded2e1dfd619d753b6c37">isConnected</a>();</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">virtual</span>  <span class="keywordtype">bool</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#afd9bd973bd376282032804001870643a">hasSoundData</a>();</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keyword">virtual</span>  <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#aca730d4953402b8ba1a9f8c8affbf8b7">setNVSInit</a>(<span class="keywordtype">bool</span> doInit);</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#a0d930cfb6d6c19e8c02fe95a2c1c7dd7">setResetBLE</a>(<span class="keywordtype">bool</span> doInit);</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;     <span class="comment">// handler for bluetooth stack enabled events</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#a71d1b1f7d91b04383d0c578a80544fbb">bt_av_hdl_stack_evt</a>(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_task_handler(<span class="keywordtype">void</span> *arg);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#a7fd7b02f3a3f7595453eb981137b3e54">bt_app_rc_ct_cb</a>(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param);</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> a2d_app_heart_beat(<span class="keywordtype">void</span> *arg);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#aae7a0b4f0f75242ceadf6e76a5863b6f">bt_app_a2d_cb</a>(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param);</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#ad3bb1aaddd9dcbd9da6a37c5aded8727">bt_app_av_sm_hdlr</a>(uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_source.html#ae9f14078c1d5dd00c93049fa8b2e283e">bt_av_hdl_avrc_ct_evt</a>(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="comment">// callback for data</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">virtual</span> int32_t get_data_default(uint8_t *data, int32_t len);</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    music_data_cb_t data_stream_callback;</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    music_data_channels_cb_t data_stream_channels_callback;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;  </div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keywordtype">bool</span> ssp_enabled;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keywordtype">char</span>* bt_name;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    std::vector&lt;char*&gt; bt_names;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    esp_bt_pin_type_t pin_type;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    esp_bt_pin_code_t pin_code;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    uint32_t pin_code_len;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    esp_bd_addr_t s_peer_bda;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    uint8_t s_peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1];</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="keywordtype">int</span> s_a2d_state;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="keywordtype">int</span> s_media_state;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordtype">int</span> s_intv_cnt;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordtype">int</span> s_connecting_intv;</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    uint32_t s_pkt_cnt;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <span class="comment">//static esp_avrc_rn_evt_cap_mask_t s_avrc_peer_rn_cap;</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    TimerHandle_t s_tmr;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    xQueueHandle s_bt_app_task_queue;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    xTaskHandle s_bt_app_task_handle;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="comment">// support for raw data</span></div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <a class="code" href="class_sound_data.html">SoundData</a> *sound_data;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    int32_t sound_data_current_pos;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="keywordtype">bool</span> has_sound_data;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="comment">// initialization</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordtype">bool</span> nvs_init = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordtype">bool</span> reset_ble = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160; </div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, <span class="keywordtype">void</span> *p_params, <span class="keywordtype">int</span> param_len, bt_app_copy_cb_t p_copy_cback);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_task_start_up(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_task_shut_down(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_av_media_proc(uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="comment">/* A2DP application state machine handler for each state */</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_av_state_unconnected(uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_av_state_connecting(uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_av_state_connected(uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_av_state_disconnecting(uint16_t event, <span class="keywordtype">void</span> *param);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;     <span class="comment">//void bt_av_notify_evt_handler(uint8_t event, esp_avrc_rn_param_t *param);</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="comment">// void bt_av_volume_changed(void);</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> bt_app_send_msg(<a class="code" href="structapp__msg__t.html">app_msg_t</a> *msg);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> bt_app_work_dispatched(<a class="code" href="structapp__msg__t.html">app_msg_t</a> *msg);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">char</span> *bda2str(esp_bd_addr_t bda, <span class="keywordtype">char</span> *str, <span class="keywordtype">size_t</span> size);</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_name_from_eir(uint8_t *eir, uint8_t *bdname, uint8_t *bdname_len);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> filter_inquiry_scan_result(esp_bt_gap_cb_param_t *param);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;};</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html">BluetoothA2DPSource</a></div><div class="ttdoc">A2DP Bluetooth Source.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.h:64</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_a0d930cfb6d6c19e8c02fe95a2c1c7dd7"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#a0d930cfb6d6c19e8c02fe95a2c1c7dd7">BluetoothA2DPSource::setResetBLE</a></div><div class="ttdeci">virtual void setResetBLE(bool doInit)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:928</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_a1c6030ee1e7e41282156fd0013a956f5"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#a1c6030ee1e7e41282156fd0013a956f5">BluetoothA2DPSource::startRaw</a></div><div class="ttdeci">virtual void startRaw(char *name, music_data_cb_t callback=NULL, bool is_ssp_enabled=false)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:161</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_a4e98bae7828ded2e1dfd619d753b6c37"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#a4e98bae7828ded2e1dfd619d753b6c37">BluetoothA2DPSource::isConnected</a></div><div class="ttdeci">virtual bool isConnected()</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:133</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_a545a8b10ab474d787744f85fe784d49a"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#a545a8b10ab474d787744f85fe784d49a">BluetoothA2DPSource::BluetoothA2DPSource</a></div><div class="ttdeci">BluetoothA2DPSource()</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:110</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_a71d1b1f7d91b04383d0c578a80544fbb"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#a71d1b1f7d91b04383d0c578a80544fbb">BluetoothA2DPSource::bt_av_hdl_stack_evt</a></div><div class="ttdeci">virtual void bt_av_hdl_stack_evt(uint16_t event, void *p_param)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:506</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_a7fd7b02f3a3f7595453eb981137b3e54"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#a7fd7b02f3a3f7595453eb981137b3e54">BluetoothA2DPSource::bt_app_rc_ct_cb</a></div><div class="ttdeci">virtual void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param)</div><div class="ttdoc">callback function for AVRCP controller</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:789</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_aa95c962faf036331a4cc6cff3e296bd8"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#aa95c962faf036331a4cc6cff3e296bd8">BluetoothA2DPSource::start</a></div><div class="ttdeci">virtual void start(char *name, music_data_channels_cb_t callback=NULL, bool is_ssp_enabled=false)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:144</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_aae7a0b4f0f75242ceadf6e76a5863b6f"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#aae7a0b4f0f75242ceadf6e76a5863b6f">BluetoothA2DPSource::bt_app_a2d_cb</a></div><div class="ttdeci">virtual void bt_app_a2d_cb(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param)</div><div class="ttdoc">callback function for A2DP source</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:559</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_aca730d4953402b8ba1a9f8c8affbf8b7"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#aca730d4953402b8ba1a9f8c8affbf8b7">BluetoothA2DPSource::setNVSInit</a></div><div class="ttdeci">virtual void setNVSInit(bool doInit)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:924</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_ad3bb1aaddd9dcbd9da6a37c5aded8727"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#ad3bb1aaddd9dcbd9da6a37c5aded8727">BluetoothA2DPSource::bt_app_av_sm_hdlr</a></div><div class="ttdeci">virtual void bt_app_av_sm_hdlr(uint16_t event, void *param)</div><div class="ttdoc">A2DP application state machine.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:570</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_ae9f14078c1d5dd00c93049fa8b2e283e"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#ae9f14078c1d5dd00c93049fa8b2e283e">BluetoothA2DPSource::bt_av_hdl_avrc_ct_evt</a></div><div class="ttdeci">virtual void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param)</div><div class="ttdoc">avrc CT event handler</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:828</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_aed4eade950c1c8e1fe22eba79cc5df43"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#aed4eade950c1c8e1fe22eba79cc5df43">BluetoothA2DPSource::writeData</a></div><div class="ttdeci">virtual bool writeData(SoundData *data)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:889</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_afb97a3f9a71350523c44774deebecc8c"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#afb97a3f9a71350523c44774deebecc8c">BluetoothA2DPSource::setPinCode</a></div><div class="ttdeci">virtual void setPinCode(char *pin_code, esp_bt_pin_type_t pin_type=ESP_BT_PIN_TYPE_VARIABLE)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:137</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_source_html_afd9bd973bd376282032804001870643a"><div class="ttname"><a href="class_bluetooth_a2_d_p_source.html#afd9bd973bd376282032804001870643a">BluetoothA2DPSource::hasSoundData</a></div><div class="ttdeci">virtual bool hasSoundData()</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSource.cpp:885</div></div>
<div class="ttc" id="aclass_sound_data_html"><div class="ttname"><a href="class_sound_data.html">SoundData</a></div><div class="ttdoc">Sound data as byte stream. We support TwoChannelSoundData (uint16_t + uint16_t) and OneChannelSoundDa...</div><div class="ttdef"><b>Definition:</b> SoundData.h:67</div></div>
<div class="ttc" id="astructapp__msg__t_html"><div class="ttname"><a href="structapp__msg__t.html">app_msg_t</a></div><div class="ttdoc">Internal message to be sent for BluetoothA2DPSink and BluetoothA2DPSource.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:28</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
